<?
if(!$pdiff) $pdiff=1;
$list1=get_upcomming_payments($pdiff);
$list=$list1[res];

$params[sid]=$sid;
$params[action]='view';
$params[pdiff]=2;
$url_last="$baseURL/$webDIR/payments/?".encode_params($params);
$params[pdiff]=1;
$url_cur="$baseURL/$webDIR/payments/?".encode_params($params);


?>
<table border=1 class='bTable' cellspacing='0'>
<tr><th colspan=10><a href="<?=$url_last?>">last month</a>&nbsp;&nbsp;&nbsp; <a  href="<?=$url_cur?>">current month</a></th><tr>
<tr>
	<th>reseller</th>
	<th>firtname</th>
	<th>lastname</th>
	<th>address1|addres2</th>
	<th>release level</th>
	<th>commission</th>
	<th>-</th>
	
<tr>
<?
	echo $list;

?>
</table>

<br><br>

<?

$params[action]="print_page";
$countr=0;

if(is_array($list1[ids])){
foreach($list1[ids] as $resid){
	if($countr>=24){
		$countr=0;
		$params[rids]=$idarr;
		$url_page="$baseURL/$webDIR/payments/?".encode_params($params);
		echo "<a href='$url_page' target=_blank>Page ".++$pages;
		$idarr=array();
	}
	$idarr[]=$resid;
	$countr++;
}
$params[rids]=$idarr;
$url_page="$baseURL/$webDIR/payments/?".encode_params($params);
echo "<a href='$url_page' target=_blank>Page ".++$pages."</a>";
}

$params[action]='print_checks';
echo "<br><br><a href='$baseURL/$webDIR/payments/?".encode_params($params)."'>Print_checks</a><br><br>";

?>

